APToolkitNET.Toolkit TK = new APToolkitNET.Toolkit();
TK.OpenOutputFile("MEMORY");
TK.SetFont("Helvetica", 24);
TK.PrintText(100, 600, "This is a test");
TK.CloseOutputFile();
// assign a byte array image of
// the output file to binImage
byte[] binImage = TK.BinaryImage;
// open a new output file to disk
TK.OpenOutputFile("output.pdf");
// use the binImage variable to
// populate the input byte stream
// using InputByteArray
TK.InputByteArray = binImage;
TK.OpenInputFile("MEMORY");
TK.CopyForm(0, 0);
TK.CloseOutputFile();